<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</head>

<body>
<?php
$host=$_POST["txt_host"];
$user=$_POST["txt_user"];
$pass=$_POST["txt_pass"];

//write xml document
  $doc = new DOMDocument();
  $doc->formatOutput = true;
  $r = $doc->createElement( "config" );
  $doc->appendChild( $r );
  
  $h = $doc->createElement( "host" );
  $h->appendChild($doc->createTextNode( $host ));
  $r->appendChild( $h );

  $u = $doc->createElement( "user" );
  $u->appendChild($doc->createTextNode( $user ));
  $r->appendChild( $u );

  $p = $doc->createElement( "pass" );
  $p->appendChild($doc->createTextNode( $pass ));
  $r->appendChild( $p );

  $doc->save("../hostconfig.xml")
?>
</body>

</html>
